package cs235.java;

/**
 * @author dtanner
 * 
 */
public class EmployeeImpl extends PersonImpl implements Employee {

    /**
     * Employees have an office.
     */
    private String realOffice;

    /**
     * Returns the employee's office address.
     * 
     * @return the employee's office address.
     */
    public final String getOffice() {
        return realOffice;
    }

    /**
     * Sets the employee's office address.
     * 
     * @param office
     *            the new value for the<br />
     *            employee's office address. This may be<br />
     *            any non-null String<br />
     * @throws IllegalArgumentException
     *             if office is null
     */
    public final void setOffice(final String office) {
        if (realOffice == null) {
            throw new IllegalArgumentException("Office cannot be null.");
        }
        this.realOffice = office;
    }

    @Override
    public final String toString() {
        return "employee\n" + getID() + "\n" + getName() + "\n" + getOffice() + "\n";
    }

}
